﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using D2D2.Server.Networking;
using D2D2.SharedInterfaces.Networking;
using Microsoft.Xna.Framework;

namespace D2D2.Server.Core
{
    public class DropManagerServer
    {
        private ServerManager _serverManager;
        private List<Drop> _drops = new List<Drop>();
        private long _dropCounter = 0;

        public DropManagerServer(ServerManager serverManager)
        {
            _serverManager = serverManager;
        }

        public void Add(Rectangle initialSprite, int curveNumber)
        {
            Drop drop = new Drop(initialSprite, curveNumber);

            long id = Interlocked.Increment(ref _dropCounter);
            drop.Id = id;

            _drops.Add(drop);

            _serverManager.SendMessage(drop);
        }
    }
}
